/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.expert.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.chlitina.store.common.persistence.BaseEntity;

/**
 * 采纳护理续买Entity
 * @author liujiang
 * @version 2013-08-27
 */
@Entity
@Table(name = "store_customer_solution_product_mix")
@IdClass(CustomerSolutionMixPK.class)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class CustomerSolutionMix extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	private CustomerSolution customerSolution;//客户采纳方案
	private SolutionFaceProductMix solutionFaceProductMix; 	// 方案产品组合

	public CustomerSolutionMix() {
	}

	public CustomerSolutionMix(Long id){
		this();
	}
	
	@Id
	@ManyToOne(cascade={CascadeType.REFRESH},fetch = FetchType.LAZY)
	@JoinColumn(name="SCS_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public CustomerSolution getCustomerSolution() {
		return customerSolution;
	}

	public void setCustomerSolution(CustomerSolution customerSolution) {
		this.customerSolution = customerSolution;
	}

	@Id
	@ManyToOne(cascade={CascadeType.REFRESH},fetch = FetchType.LAZY)
	@JoinColumn(name="MIX_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public SolutionFaceProductMix getSolutionFaceProductMix() {
		return solutionFaceProductMix;
	}

	public void setSolutionFaceProductMix(SolutionFaceProductMix solutionFaceProductMix) {
		this.solutionFaceProductMix = solutionFaceProductMix;
	}
}


